package com.yaowk.common.api;

import io.swagger.annotations.ApiModelProperty;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by yaowk on 17-9-14.
 */
public class PageResp<M> extends PageReq {

    public PageResp() {
    }

    public PageResp(PageResp pageResp) {
        setPageNumber(pageResp.getPageNumber());
        setPageSize(pageResp.getPageSize());
        setTotalPage(pageResp.getTotalPage());
        setTotalRow(pageResp.getTotalRow());
        setList(new ArrayList<>());
    }

    @ApiModelProperty(value = "总数量")
    private long totalRow;
    @ApiModelProperty(value = "总页数")
    private int totalPage;
    @ApiModelProperty(value = "返回数据")
    private List<M> list;


    public int getTotalPage() {
        return totalPage;
    }

    public void setTotalPage(int totalPage) {
        this.totalPage = totalPage;
    }

    public long getTotalRow() {
        return totalRow;
    }

    public void setTotalRow(long totalRow) {
        this.totalRow = totalRow;
    }

    public List<M> getList() {
        return list;
    }

    public void setList(List<M> list) {
        this.list = list;
    }
}
